home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pp / pp-6.0 / Src / MTAconsole / bops.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-18  |  31.3 KB  |  1,401 lines

  1. /* bops.c: various buttons routines */
  2.  
  3. # ifndef lint
  4. static char Rcsid[] = "@(#)$Header: /xtel/pp/pp-beta/Src/MTAconsole/RCS/bops.c,v 6.0 1991/12/18 20:26:48 jpo Rel $";
  5. # endif
  6.  
  7. /*
  8.  * $Header: /xtel/pp/pp-beta/Src/MTAconsole/RCS/bops.c,v 6.0 1991/12/18 20:26:48 jpo Rel $
  9.  *
  10.  * $Log: bops.c,v $
  11.  * Revision 6.0  1991/12/18  20:26:48  jpo
  12.  * Release 6.0
  13.  *
  14.  */
  15.  
  16.  
  17.  
  18. #include    "console.h"
  19. extern int    autoReconnect,
  20.         userConnected;
  21. extern State    connectState;
  22. extern struct chan_struct    *find_channel();
  23. extern struct mta_struct    *find_mta();
  24. extern struct msg_struct    *find_msg();
  25. extern Widget    top;
  26. extern char    *reverse_mta();
  27. extern int    uk_order;
  28. extern int    compat;
  29. extern int    displayInactIns;
  30. extern Heuristic heuristic,
  31.         newheur;
  32.  
  33. void        SetAuthDisplay();
  34.  
  35. /* ARGSUSED */ 
  36. void Refresh(w, client_data, call_data)
  37. Widget    w;
  38. caddr_t    client_data;    /* unused */
  39. caddr_t call_data;    /* unused */
  40. {
  41. /*    StartWait();*/
  42.     if (connectState == connected) {
  43.         if (!compat)
  44.             my_invoke(qmgrStatus, (char **) NULL);
  45.         my_invoke(chanread, (char **) NULL);
  46.     } else if (autoReconnect == TRUE && userConnected == TRUE) {
  47.         TermConnectTimeOut();
  48.         ConnectTimeOut((caddr_t) NULL,(XtIntervalId *) NULL);
  49.     }
  50.     ResetInactiveTimeout();
  51. /*    EndWait();*/
  52. }
  53.  
  54. extern time_t    parsetime();
  55. Operations            currentop;
  56. extern struct chan_struct    *currentchan;
  57. extern struct mta_struct    *currentmta;
  58. extern struct msg_struct    *currentmsg;
  59. extern int            confirm, read_currentchan;
  60. extern char            *hostname;
  61. extern Popup_menu        *yesno,
  62.                 *one,
  63.                 *two,
  64.                 *three;
  65. int                forceDown = FALSE;
  66.  
  67. /* ARGSUSED */
  68. void Command(w, op, call_data)
  69. Widget    w;
  70. Operations    op;    
  71. caddr_t    call_data;    /* unused */
  72. {
  73.     char        *title;
  74.     int        x, y;
  75.     Popup_menu    *popup = NULL;
  76.     Window        r_child;
  77.  
  78.     ResetInactiveTimeout();
  79.     XtVaGetValues(w,
  80.           XtNlabel, &title,
  81.           NULL);
  82.  
  83.     if (strcmp(title, "all") == 0) {
  84.         if (op == chaninfo)
  85.             chan_display_all();
  86.         else if (op == mtainfo)
  87.             mta_display_all();
  88.         else if (op == msginfo) 
  89.             msg_display_all();
  90.         return;
  91.     }
  92.  
  93.     currentop = op;
  94. /*    StartWait();    */
  95.     /* should pop up template hereabouts */
  96.     switch (op) {
  97.         case quit:
  98.         if (confirm == TRUE) {
  99.             popup = yesno;
  100.         } else {
  101.             Quit();
  102.         }
  103.         break;
  104.         case connect:
  105.         case disconnect:
  106.         if (strcmp(title, "connect") == 0) {
  107.             currentop = connect;
  108.             popup = one;
  109.             textdisplay(&(one->tuple[0]), 
  110.                 (hostname == NULL) ? "" : hostname);
  111.             XtVaSetValues(one->tuple[0].label,
  112.                   XtNlabel, "Connect to ",
  113.                   NULL);
  114.         } else {
  115.             currentop = disconnect;
  116.             if (confirm == TRUE) {
  117.                 popup = yesno;
  118.             } else {
  119.                 Disconnect();
  120.             }
  121.         }
  122.         break;
  123.         case chanstart:
  124.         if (currentchan == NULL) {
  125.             textdisplay(&(one->tuple[0]), "");
  126.             XtVaSetValues(one->tuple[0].label, 
  127.                   XtNlabel, "Enable channel",
  128.                   NULL);
  129.             popup = one;
  130.         } else 
  131.             ChanControl(currentop, currentchan->channelname, 
  132.                     (char *) NULL);
  133.         break;
  134.         case chanstop:
  135.         if (currentchan == NULL) {
  136.             textdisplay(&(one->tuple[0]), "");
  137.             XtVaSetValues(one->tuple[0].label, 
  138.                   XtNlabel, "Disable channel",
  139.                   NULL);
  140.             popup = one;
  141.         } else 
  142.             ChanControl(currentop, currentchan->channelname, 
  143.                     (char *) NULL);
  144.         break;
  145.         case chanclear:
  146.         if (currentchan == NULL) {
  147.             textdisplay(&(one->tuple[0]), "");
  148.             XtVaSetValues(one->tuple[0].label, 
  149.                   XtNlabel, "Remove delay on channel",
  150.                   NULL);
  151.             popup = one;
  152.         } else 
  153.             ChanControl(currentop, currentchan->channelname, 
  154.                     (char *) NULL);
  155.         break;
  156.         case chancacheadd:
  157.         popup = two;
  158.         XtVaSetValues(two->tuple[0].label,
  159.               XtNlabel, "Add delay (in s m h d and/or w)",
  160.               NULL);
  161.         XtVaSetValues(two->tuple[1].label,
  162.               XtNlabel, "On channel",
  163.               NULL);
  164.         textdisplay(&(two->tuple[1]),
  165.                 (currentchan == NULL) ? "" : currentchan->channelname);
  166.         textdisplay(&(two->tuple[0]), "");
  167.         break;
  168.             
  169.         case chaninfo:
  170.         if (currentchan == NULL) {
  171.             textdisplay(&(one->tuple[0]), "");
  172.             XtVaSetValues(one->tuple[0].label, 
  173.                   XtNlabel, "Info on channel",
  174.                   NULL);
  175.             popup = one;
  176.         } else
  177.             ChanInfo(currentchan->channelname);
  178.         break;
  179.  
  180.         case channext:
  181.         ChanNext();
  182.         break;
  183.  
  184.         case chanprev:
  185.         ChanPrev();
  186.         break;
  187.             
  188.         case chandownforce:
  189.         if (currentchan == NULL) {
  190.             textdisplay (&(one->tuple[0]), "");
  191.             XtVaSetValues(one->tuple[0].label,
  192.                   XtNlabel, "Downward force attempt on channel",
  193.                   NULL);
  194.             popup = one;
  195.         } else {
  196.             forceDown = TRUE;
  197.             ChanDownForce (currentchan);
  198.             forceDown = FALSE;
  199.         }
  200.         break;
  201.  
  202.         case mtastart:
  203.         if (currentmta == NULL
  204.             || currentchan == NULL) {
  205.             textdisplay(&(two->tuple[0]), 
  206.                     (currentmta == NULL) ? "" : currentmta->mta);
  207.             XtVaSetValues(two->tuple[0].label,
  208.                   XtNlabel, "Enable mta  ",
  209.                   NULL);  
  210.             textdisplay(&(two->tuple[1]),
  211.                     (currentchan == NULL) ? "" : currentchan->channelname);
  212.             XtVaSetValues(two->tuple[1].label,
  213.                   XtNlabel, "On channel",
  214.                   (char *) NULL);
  215.             popup = two;
  216.         } else 
  217.             MtaControl(currentop, 
  218.                    currentmta->mta,
  219.                    currentchan->channelname,
  220.                    (char *) NULL);
  221.         break;
  222.  
  223.         case mtastop:
  224.         if (currentmta == NULL
  225.             || currentchan == NULL) {
  226.             textdisplay(&(two->tuple[0]), 
  227.                     (currentmta == NULL) ? "" : currentmta->mta);
  228.             XtVaSetValues(two->tuple[0].label,
  229.                   XtNlabel, "Disable mta  ",
  230.                   NULL);
  231.             textdisplay(&(two->tuple[1]),
  232.                     (currentchan == NULL) ? "" : currentchan->channelname);
  233.             XtVaSetValues(two->tuple[1].label,
  234.                   XtNlabel, "On channel",
  235.                   NULL);
  236.             popup = two;
  237.         } else 
  238.             MtaControl(currentop, 
  239.                    currentmta->mta,
  240.                    currentchan->channelname,
  241.                    (char *) NULL);
  242.         break;
  243.         case mtaclear:
  244.         if (currentmta == NULL
  245.             || currentchan == NULL) {
  246.             textdisplay(&(two->tuple[0]), 
  247.                     (currentmta == NULL) ? "" : currentmta->mta);
  248.             XtVaSetValues(two->tuple[0].label,
  249.                   XtNlabel, "Remove delay on mta",
  250.                   NULL);
  251.             textdisplay(&(two->tuple[1]),
  252.                     (currentchan == NULL) ? "" : currentchan->channelname);
  253.             XtVaSetValues(two->tuple[1].label,
  254.                   XtNlabel, "On channel",
  255.                   NULL);
  256.             popup = two;
  257.         } else 
  258.             MtaControl(currentop, 
  259.                    currentmta->mta,
  260.                    currentchan->channelname,
  261.                    (char *) NULL);
  262.  
  263.         break;
  264.         case mtaforce:
  265.         if (currentmta == NULL
  266.             || currentchan == NULL) {
  267.             textdisplay(&(two->tuple[0]), 
  268.                     (currentmta == NULL) ? "" : currentmta->mta);
  269.             XtVaSetValues(two->tuple[0].label,
  270.                   XtNlabel, "Force attempt of mta",
  271.                   NULL);
  272.             textdisplay(&(two->tuple[1]),
  273.                     (currentchan == NULL) ? "" : currentchan->channelname);
  274.             XtVaSetValues(two->tuple[1].label,
  275.                   XtNlabel, "On channel",
  276.                   NULL);
  277.             popup = two;
  278.         } else 
  279.             MtaForce(currentmta,
  280.                  currentchan);
  281.  
  282.         break;
  283.  
  284.         case mtadownforce:
  285.         if (currentmta == NULL
  286.             || currentchan == NULL) {
  287.             textdisplay(&(two->tuple[0]), 
  288.                     (currentmta == NULL) ? "" : currentmta->mta);
  289.             XtVaSetValues(two->tuple[0].label,
  290.                   XtNlabel, "Downward force attempt of mta",
  291.                   NULL);
  292.             textdisplay(&(two->tuple[1]),
  293.                     (currentchan == NULL) ? "" : currentchan->channelname);
  294.             XtVaSetValues(two->tuple[1].label,
  295.                   XtNlabel, "On channel",
  296.                   NULL);
  297.             popup = two;
  298.         } else {
  299.             forceDown = TRUE;
  300.             MtaDownForce(currentchan,
  301.                  currentmta);
  302.             forceDown = FALSE;
  303.         }
  304.         break;
  305.         case mtacacheadd:
  306.         popup = three;
  307.         XtVaSetValues(three->tuple[0].label,
  308.               XtNlabel, "Add delay (in s m h d and/or w)",
  309.               NULL);
  310.         textdisplay(&(three->tuple[0]), "");
  311.         XtVaSetValues(three->tuple[1].label,
  312.               XtNlabel, "For mta",
  313.               NULL);
  314.         textdisplay(&(three->tuple[1]),
  315.                 (currentmta == NULL) ? "" : currentmta->mta);
  316.         XtVaSetValues(three->tuple[2].label,
  317.               XtNlabel,"On channel",
  318.               NULL);
  319.         textdisplay(&(three->tuple[2]),
  320.                 (currentchan == NULL) ? "" : currentchan->channelname);
  321.         break;
  322.         case mtainfo:
  323.         if (currentmta == NULL
  324.             || currentchan == NULL) {
  325.             textdisplay(&(two->tuple[0]), 
  326.                     (currentmta == NULL) ? "" : currentmta->mta);
  327.             XtVaSetValues(two->tuple[0].label,
  328.                   XtNlabel, "Info on mta",
  329.                   NULL);
  330.             textdisplay(&(two->tuple[1]),
  331.                     (currentchan == NULL) ? "" : currentchan->channelname);
  332.             XtVaSetValues(two->tuple[1].label,
  333.                   XtNlabel, "On channel",
  334.                   NULL);
  335.             popup = two;
  336.         } else 
  337.             MtaInfo(currentmta->mta,
  338.                 currentchan->channelname);
  339.         break;
  340.  
  341.         case mtanext:
  342.         MtaNext();
  343.         break;
  344.         
  345.         case mtaprev:
  346.         MtaPrev();
  347.         break;
  348.  
  349.         case msgstart:
  350.         popup = two;
  351.         XtVaSetValues(two->tuple[0].label,
  352.               XtNlabel, "Thaw message",
  353.               NULL);
  354.         textdisplay(&(two->tuple[0]),
  355.                 (currentmsg == NULL) ? "" : currentmsg->msginfo->queueid);
  356.         textdisplay(&(two->tuple[1]), "");
  357.         XtVaSetValues(two->tuple[1].label,
  358.               XtNlabel, "User list (,) *=all",
  359.               NULL);
  360.         break;
  361.         case msgstop:
  362.         popup = two;
  363.         XtVaSetValues(two->tuple[0].label,
  364.               XtNlabel, "Freeze message  ",
  365.               NULL);
  366.         textdisplay(&(two->tuple[0]),
  367.                 (currentmsg == NULL) ? "" : currentmsg->msginfo->queueid);
  368.         textdisplay(&(two->tuple[1]), "");
  369.         XtVaSetValues(two->tuple[1].label,
  370.               XtNlabel, "User list (,) *=all",
  371.               NULL);
  372.         break;
  373.         case msgclear:
  374.         popup = two;
  375.         XtVaSetValues(two->tuple[0].label,
  376.               XtNlabel, "Remove delay on message",
  377.               NULL);
  378.         textdisplay(&(two->tuple[0]),
  379.                 (currentmsg == NULL) ? "" : currentmsg->msginfo->queueid);
  380.         textdisplay(&(two->tuple[1]), "");
  381.         XtVaSetValues(two->tuple[1].label,
  382.               XtNlabel, "User list (,) *=all",
  383.               NULL);
  384.         break;
  385.         case msgforce:
  386.         if (currentmta == NULL) {
  387.             popup = three;
  388.             XtVaSetValues(three->tuple[0].label,
  389.                   XtNlabel, "Force Attempt on Message",
  390.                   NULL);
  391.             textdisplay(&(three->tuple[0]),
  392.                     (currentmsg == NULL) ? "" : currentmsg->msginfo->queueid);
  393.             XtVaSetValues(three->tuple[1].label,
  394.                   XtNlabel, "User list (,) *=all",
  395.                   NULL);
  396.             textdisplay(&(three->tuple[1]),"");
  397.             XtVaSetValues(three->tuple[2].label,
  398.                   XtNlabel, "On Mta",
  399.                   NULL);
  400.             textdisplay(&(three->tuple[2]),"");
  401.         } else {
  402.             /* know what mta is */
  403.             popup = two;
  404.             XtVaSetValues(two->tuple[0].label,
  405.                   XtNlabel, "Force Attempt on Message",
  406.                   NULL);
  407.             textdisplay(&(two->tuple[0]),
  408.                     (currentmsg == NULL) ? "" : currentmsg->msginfo->queueid);
  409.             XtVaSetValues(two->tuple[1].label,
  410.                   XtNlabel, "User list (,) *=all",
  411.                   NULL);
  412.             textdisplay(&(two->tuple[1]),"");
  413.         }
  414.         break;
  415.         case msginfo:
  416.         if (currentmsg == NULL) {
  417.             popup = one;
  418.             XtVaSetValues(one->tuple[0].label,
  419.                   XtNlabel, "Info on message",
  420.                   NULL);
  421.             textdisplay(&(one->tuple[0]), "");
  422.         } else 
  423.             MsgInfo(currentmsg->msginfo->queueid);
  424.             
  425.         break;
  426.  
  427.         case msgnext:
  428.         MsgNext();
  429.         break;
  430.         
  431.         case msgprev:
  432.         MsgPrev();
  433.         break;
  434.  
  435.         case msgcacheadd:
  436.         popup = three;
  437.         XtVaSetValues(three->tuple[0].label,
  438.               XtNlabel, "Add delay (in s m h d and/or w)",
  439.               NULL);
  440.         textdisplay(&(three->tuple[0]), "");
  441.         XtVaSetValues(three->tuple[1].label,
  442.               XtNlabel, "To message",
  443.               NULL);
  444.         textdisplay(&(three->tuple[1]),
  445.                 (currentmsg == NULL) ? "" : currentmsg->msginfo->queueid);
  446.         XtVaSetValues(three->tuple[2].label,
  447.               XtNlabel, "User list (,) *=all",
  448.               NULL);
  449.         textdisplay(&(three->tuple[2]), "");
  450.         break;
  451.         default:
  452.         popup = one;
  453.         XtVaSetValues(one->tuple[0].label,
  454.               XtNlabel, "WHAT ????????",
  455.               NULL);
  456.         break;
  457.     }
  458. /*    EndWait();*/
  459.     if (popup != NULL) {
  460.         XTranslateCoordinates(XtDisplay(w),XtWindow(w),
  461.                       XDefaultRootWindow(XtDisplay(w)),0,0,
  462.                       &x,&y,
  463.                       &r_child);
  464.         Popup(popup,currentop,x,y);
  465.     }
  466.     
  467. }
  468.  
  469. extern Popup_menu    *connectpopup;
  470. extern int        newauth,
  471.             auth;
  472. extern char        password[],
  473.             username[],
  474.             tailorfile[];
  475.  
  476. /* ARGSUSED */
  477. void Connectbutton(w, op, call_data)
  478. Widget    w;
  479. Operations    op;    
  480. caddr_t    call_data;    /* unused */
  481. {
  482.     char        *title;
  483.     int        x, y;
  484.     Popup_menu    *popup = NULL;
  485.     Window        r_child;
  486.     
  487.     XtVaGetValues(w,
  488.           XtNlabel, &title,
  489.           NULL);
  490.  
  491.     currentop = op;
  492.     if (strcmp(title, "connect") == 0) {
  493.         currentop = connect;
  494.         newauth = auth;
  495.         SetAuthDisplay(newauth);
  496.         popup = connectpopup;
  497.         textdisplay(&(connectpopup->tuple[0]), 
  498.                 (hostname == NULL) ? "" : hostname);
  499.         textdisplay(&(connectpopup->tuple[1]),
  500.                 (tailorfile[0] == '\0') ? "" : tailorfile);
  501.     } else {
  502.         currentop = disconnect;
  503.         if (confirm == TRUE) {
  504.             popup = yesno;
  505.         } else {
  506.             Disconnect();
  507.         }
  508.     }
  509.     if (popup != NULL) {
  510.         XTranslateCoordinates(XtDisplay(w),XtWindow(w),
  511.                       XDefaultRootWindow(XtDisplay(w)),0,0,
  512.                       &x,&y,
  513.                       &r_child);
  514.         Popup(popup,currentop,x,y);
  515.     }
  516. }
  517.  
  518. Mode    mode = monitor;
  519. extern Widget    mode_command, channel_label, qcontrol_command;
  520. extern Authentication authentication;
  521. extern void ChanToggle();
  522.  
  523. /* ARGSUSED */
  524. void    ChangeMode(w, client_data, call_data)
  525. Widget    w;
  526. caddr_t    client_data;
  527. caddr_t call_data;
  528. {
  529.     extern Widget    channel_form,
  530.             monitor_viewport,
  531.             control_form;
  532. /*    StartWait();*/
  533.     if (mode == monitor) {
  534.         XtVaSetValues(mode_command,
  535.             XtNlabel, "monitor",
  536.             NULL);
  537.         mode = control;
  538.         toggle_info_displays();
  539.         reset_label(channel_label);
  540.         XtSetMappedWhenManaged(monitor_viewport, False);
  541.         XtSetMappedWhenManaged(control_form, True);
  542.         XtSetMappedWhenManaged(channel_form, True);
  543.         if (authentication == full && connectState == connected)
  544.             XtSetMappedWhenManaged(qcontrol_command, True);
  545.         if (currentchan != NULL && read_currentchan != 0) {
  546.             clear_mta_refresh_list();
  547.             add_mta_refresh_list(currentchan->channelname);
  548.             construct_event(mtaread);
  549.         }
  550.     } else {
  551.         XtVaSetValues(mode_command, 
  552.               XtNlabel, "control", 
  553.               NULL);
  554.         mode = monitor;
  555.         ChanToggle();
  556.         XtSetMappedWhenManaged(monitor_viewport, True);
  557.         XtSetMappedWhenManaged(control_form, False);
  558.         XtSetMappedWhenManaged(channel_form, False);
  559.         if (authentication == full)
  560.             XtSetMappedWhenManaged(qcontrol_command, False);
  561.         if (connectState == connected) {
  562.             if (!compat)
  563.                 my_invoke(qmgrStatus, (char **) NULL);
  564.             my_invoke(chanread,(char **) NULL);
  565.         }
  566.     }
  567. /*    EndWait();*/
  568.     ResetInactiveTimeout();
  569. }
  570.  
  571. extern unsigned long     timeoutFor,
  572.             inactiveFor,
  573.             connectInit,
  574.             connectInc,
  575.             connectMax;
  576. extern char    *unparsetime();
  577. extern Popup_menu    *config;
  578. extern Widget        refresh_toggle,
  579.             reconnect_toggle,
  580.             backoff_toggle,
  581.             confirm_toggle,
  582.             compat_toggle,
  583.             inbounds_toggle,
  584.             heur_toggle;
  585. extern int    autoRefresh,
  586.         autoReconnect,
  587.         backoff,
  588.         percent,
  589.         lower_bound_mtas,
  590.         max_vert_lines;
  591. extern int    newautoRefresh,
  592.         newautoReconnect,
  593.         newbackoff,
  594.         newconfirm,
  595.         newcompat,
  596.         newdisplayInactIns;
  597. int        newint;
  598. unsigned long    newTimes;
  599. extern XColor    white, black;
  600. extern Pixel    bg, fg;
  601.  
  602. /* ARGSUSED */
  603. void Configure(w, client_data, call_data)
  604. Widget    w;
  605. caddr_t    client_data;    /* unused */
  606. caddr_t call_data;    /* unused */
  607. {
  608.     int    x,y,i;
  609.     Window    r_child;
  610.     char    number[BUFSIZ], *str;
  611.  
  612.     newautoRefresh = autoRefresh;
  613.     newautoReconnect = autoReconnect;
  614.     newbackoff = backoff;
  615.     newconfirm = confirm;
  616.     newcompat = compat;
  617.     newdisplayInactIns = displayInactIns;
  618.     newheur = heuristic;
  619.     XawFormDoLayout (config->form, False);
  620.     textdisplay(&(config->tuple[REFRESH]), 
  621.             unparsetime(timeoutFor / 1000 ));
  622.     textdisplay(&(config->tuple[INACTIVE]),
  623.             unparsetime(inactiveFor / 1000));
  624.     textdisplay(&(config->tuple[START]), 
  625.             unparsetime(connectInit / 1000 ));
  626.     textdisplay(&(config->tuple[BACKOFF]),     
  627.             unparsetime(connectInc / 1000 ));
  628.     textdisplay(&(config->tuple[CONNECTMAX]), 
  629.             unparsetime(connectMax / 1000 ));
  630.     sprintf(number, "%d", percent);
  631.     textdisplay(&(config->tuple[PERCENT]),number);
  632.     sprintf(number, "%d", lower_bound_mtas);
  633.     textdisplay(&(config->tuple[MINBADMTA]), number);
  634.     sprintf(number, "%d", max_vert_lines);
  635.     textdisplay(&(config->tuple[LINEMAX]), number);
  636.     
  637.     XtSetKeyboardFocus(config->form, config->tuple[REFRESH].text);
  638.     XtVaSetValues(config->tuple[REFRESH].text,
  639.           XtNborderColor, fg,
  640.           NULL);
  641.     XtVaSetValues (refresh_toggle,
  642.            XtNlabel, (autoRefresh == TRUE) ? "enabled" : "disabled",
  643.            NULL);
  644.     XtVaSetValues (reconnect_toggle,
  645.            XtNlabel, (autoReconnect == TRUE) ? "enabled" : "disabled",
  646.            NULL);
  647.     XtVaSetValues (backoff_toggle,
  648.            XtNlabel, (backoff == TRUE) ? "enabled" : "disabled",
  649.            NULL);
  650.     XtVaSetValues (confirm_toggle,
  651.            XtNlabel, (confirm == TRUE) ? "enabled" : "disabled",
  652.            NULL);
  653.     XtVaSetValues (compat_toggle,
  654.            XtNlabel, (compat == TRUE) ? "enabled" : "disabled",
  655.            NULL);
  656.     XtVaSetValues (inbounds_toggle,
  657.            XtNlabel, (displayInactIns == TRUE) ? "enabled" : "disabled",
  658.            NULL);
  659.  
  660.     switch (heuristic) {
  661.         case percentage:
  662.         str = PERCENT_BASED;
  663.         break;
  664.         case all:
  665.         str = ALL_BASED;
  666.         break;
  667.         case chanonly:
  668.         str = CHANONLY_BASED;
  669.         break;
  670.         default:
  671.         heuristic = line;
  672.         case line:
  673.         str = LINE_BASED;
  674.         break;
  675.     }
  676.     XtVaSetValues (heur_toggle,
  677.            XtNlabel,    str,
  678.            NULL);
  679.  
  680.     for (i = 1; i < config->numberOftuples; i++) 
  681.         XtVaSetValues(config->tuple[i].text,
  682.               XtNborderColor, bg,
  683.               NULL);
  684.     XawFormDoLayout (config->form, True);
  685.     XTranslateCoordinates(XtDisplay(w),XtWindow(w),
  686.                   XDefaultRootWindow(XtDisplay(w)),0,0,&x,&y,
  687.                   &r_child);
  688.     Popup(config, unknown, x, y);
  689. }
  690.  
  691. /* ARGSUSED */
  692. void popup_NOTOK(w, op, call_data)
  693. Widget    w;
  694. Operations    *op;
  695. caddr_t call_data;
  696. {
  697.     Popup_menu    *popup;
  698.     
  699.     switch(*op) {
  700.         case quit:
  701.         case disconnect:
  702.         popup = yesno;
  703.         break;
  704.         case connect:
  705.         popup = connectpopup;
  706.         break;
  707.         case chanread:
  708.         case chanstop:
  709.         case chanstart:
  710.         case chanclear:
  711.         case chaninfo:
  712.         case chandownforce:
  713.         case msginfo:
  714.         popup = one;
  715.         break;
  716.         case chancacheadd:
  717.         case mtaread:
  718.         case mtastop:
  719.         case mtastart:
  720.         case mtaclear:
  721.         case msgstop:
  722.         case msgstart:
  723.         case msgclear:
  724.         case mtainfo:
  725.         case mtaforce:
  726.         case mtadownforce:
  727.         popup = two;
  728.         break;
  729.         case mtacacheadd:
  730.         case msgcacheadd:
  731.         popup = three;
  732.         break;
  733.         case msgforce:
  734.         if (currentmta == NULL)
  735.             popup = three;
  736.         else 
  737.             popup = two;
  738.         break;
  739.         default:
  740.         popup = config;
  741.         break;
  742.     }
  743.     ResetInactiveTimeout();
  744.     if (popup != NULL)
  745.         Popdown(popup);
  746. }
  747.  
  748. /* ARGSUSED */
  749. void popup_OK(w, op, call_data)
  750. Widget    w;
  751. Operations    *op;
  752. caddr_t     call_data;
  753. {
  754.     Popup_menu    *popup = NULL;
  755.     struct chan_struct    *chan;
  756.     char    *str0, *str1, *str2;
  757.     char    *ch;
  758.  
  759.     XSync(XtDisplay(w), 0);
  760.     switch(*op) {
  761.         case quit:
  762.         Quit();
  763.         popup = yesno;
  764.         break;
  765.         case disconnect:
  766.         Disconnect();
  767.         popup = yesno;
  768.         break;
  769.         case chanstop:
  770.         case chanstart:
  771.         case chanclear:
  772.         XtVaGetValues(one->tuple[0].text,
  773.                   XtNstring, &str0,
  774.                   NULL);
  775.         if (str0[0] != '\0') {
  776.             ChanControl(*op, str0, (char *) NULL);
  777.             popup = one;
  778.         }
  779.         break;
  780.         case chancacheadd:
  781.         XtVaGetValues(two->tuple[0].text,
  782.                   XtNstring, &str0,
  783.                   NULL);
  784.         XtVaGetValues(two->tuple[1].text,
  785.                   XtNstring, &str1,
  786.                   NULL);
  787.         if (str0[0] != '\0' 
  788.             && str1[0] != '\0') {
  789.             ChanControl(*op, str1, str0);
  790.             popup = two;
  791.         }
  792.         break;
  793.         case chaninfo:
  794.         XtVaGetValues(one->tuple[0].text,
  795.                   XtNstring, &str0,
  796.                   NULL);
  797.  
  798.         if (str0[0] != '\0') {
  799.             ChanInfo(str0);
  800.             popup = one;
  801.         }
  802.         break;
  803.         case chandownforce:
  804.         XtVaGetValues(one->tuple[0].text,
  805.                   XtNstring, &str0,
  806.                   NULL);
  807.         if (str0[0] != '\0') {
  808.             if ((chan = find_channel(str0)) != NULL){
  809.                 forceDown = TRUE;
  810.                 ChanDownForce(chan);
  811.                 forceDown = FALSE;
  812.                 popup = one;
  813.             }
  814.         }
  815.         break;
  816.         case msgstop:
  817.         case msgstart:
  818.         case msgclear:
  819.         XtVaGetValues(two->tuple[0].text,
  820.                   XtNstring, &str0,
  821.                   NULL);
  822.         XtVaGetValues(two->tuple[1].text,
  823.                   XtNstring, &str1,
  824.                   NULL);
  825.         
  826.         if (str0[0] != '\0' && str1[0] != '\0') {
  827.             MsgControl(*op, str0, 
  828.                    str1, (char *) NULL);
  829.             popup = two;
  830.         }
  831.         break;
  832.         case msgforce:
  833.         if (currentchan == NULL)
  834.             break;
  835.         if (currentmta == NULL) {
  836.             XtVaGetValues(three->tuple[0].text,
  837.                       XtNstring, &str0,
  838.                       NULL);
  839.             XtVaGetValues(three->tuple[1].text,
  840.                       XtNstring, &str1,
  841.                       NULL);
  842.             XtVaGetValues(three->tuple[2].text,
  843.                       XtNstring, &str2,
  844.                       NULL);
  845.  
  846.             if (str0[0] != '\0'
  847.                 && str1[0] != '\0'
  848.                 && str2[0] != '\0') {
  849.                 struct mta_struct    *mta = NULL;
  850.                 struct msg_struct    *msg = NULL;
  851.                 char            *ch = NULL;
  852.                 
  853.                 ch = (uk_order) ? reverse_mta(str2) : str2;
  854.                 if ((mta = find_mta(currentchan,
  855.                             ch)) != NULL
  856.                     && (msg = find_msg(str0)) != NULL) {
  857.                     MsgForce(msg, str1,
  858.                          mta, currentchan);
  859.                     popup = three;
  860.                 }
  861.                 if (uk_order && ch != str2) free(ch);
  862.             } 
  863.         } else {
  864.             XtVaGetValues(two->tuple[0].text,
  865.                       XtNstring, &str0,
  866.                       NULL);
  867.             XtVaGetValues(two->tuple[1].text,
  868.                       XtNstring, &str1,
  869.                       NULL);
  870.  
  871.             if (str0[0] != '\0'
  872.                 && str1[0] != '\0') {
  873.                 struct msg_struct    *msg;
  874.                 if ((msg = find_msg(str0)) != NULL) {
  875.                     MsgForce(msg, str1,
  876.                          currentmta, currentchan);
  877.                     popup = two;
  878.                 }
  879.             }
  880.         }
  881.         break;
  882.         case msgcacheadd:
  883.         XtVaGetValues(three->tuple[0].text,
  884.                   XtNstring, &str0,
  885.                   NULL);
  886.         XtVaGetValues(three->tuple[1].text,
  887.                   XtNstring, &str1,
  888.                   NULL);
  889.         XtVaGetValues(three->tuple[2].text,
  890.                   XtNstring, &str2,
  891.                   NULL);
  892.  
  893.         if (str0[0] != '\0'
  894.             && str1[0] != '\0'
  895.             && str2[0] != '\0') {
  896.             MsgControl(*op, str1,
  897.                    str2, str0);
  898.             popup = three;
  899.         }
  900.         break;
  901.           
  902.         case msginfo:
  903.         XtVaGetValues(one->tuple[0].text,
  904.                   XtNstring, &str0,
  905.                   NULL);
  906.  
  907.         if (str0[0] != '\0') {
  908.             MsgInfo(str0);
  909.             popup = one;
  910.         }
  911.         break;
  912.         case mtaclear:
  913.         case mtastop:
  914.         case mtastart:
  915.         XtVaGetValues(two->tuple[0].text,
  916.                   XtNstring, &str0,
  917.                   NULL);
  918.         XtVaGetValues(two->tuple[1].text,
  919.                   XtNstring, &str1,
  920.                   NULL);
  921.         
  922.         if (str0[0] != '\0'
  923.             && str1[0] != '\0') {
  924.             ch = (uk_order) ? reverse_mta(str0) : str0;
  925.             MtaControl(*op, ch, 
  926.                    str1, (char *) NULL);
  927.             if (uk_order && ch != str0) free (ch);
  928.             popup = two;
  929.         }
  930.         break;
  931.         case mtaforce:
  932.         XtVaGetValues(two->tuple[0].text,
  933.                   XtNstring, &str0,
  934.                   NULL);
  935.         XtVaGetValues(two->tuple[1].text,
  936.                   XtNstring, &str1,
  937.                   NULL);
  938.  
  939.         if (str0[0] != '\0'
  940.             && str1[0] != '\0') {
  941.             struct mta_struct    *mta;
  942.             struct chan_struct    *chan;
  943.             ch = (uk_order) ? reverse_mta(str0) : str0;
  944.             if ((chan = find_channel(str1)) != NULL
  945.                 && (mta = find_mta(chan,
  946.                            ch)) != NULL) {
  947.                 MtaForce(mta, chan);
  948.                 popup = two;
  949.             }
  950.             if (uk_order && ch != str0) free(ch);
  951.         }
  952.         break;
  953.  
  954.         case mtadownforce:
  955.         XtVaGetValues(two->tuple[0].text,
  956.                   XtNstring, &str0,
  957.                   NULL);
  958.         XtVaGetValues(two->tuple[1].text,
  959.                   XtNstring, &str1,
  960.                   NULL);
  961.  
  962.         if (str0[0] != '\0'
  963.             && str1[0] != '\0') {
  964.             struct mta_struct    *mta;
  965.             struct chan_struct    *chan;
  966.             if ((chan = find_channel(str1)) != NULL) {
  967.                 if (chan->num_mtas == 0)
  968.                     my_invoke(mtaread, 
  969.                           &(chan->channelname)); 
  970.                 ch = (uk_order) ? reverse_mta(str0) : str0;
  971.                 if((mta = find_mta(chan,
  972.                            ch)) != NULL) {
  973.                     forceDown = TRUE;
  974.                     MtaDownForce(chan, mta);
  975.                     forceDown = FALSE;
  976.                     popup = two;
  977.                 }
  978.                 if (uk_order && ch != str0) free(ch);
  979.             }
  980.         }
  981.         break;
  982.  
  983.         case mtainfo:
  984.         XtVaGetValues(two->tuple[0].text,
  985.                   XtNstring, &str0,
  986.                   NULL);
  987.         XtVaGetValues(two->tuple[1].text,
  988.                   XtNstring, &str1,
  989.                   NULL);
  990.  
  991.         if (str0[0] != '\0'
  992.             && str1[0] != '\0') {
  993.             ch = (uk_order) ? reverse_mta(str0) : str0;
  994.             MtaInfo(ch, str1);
  995.             if (uk_order && ch != str0) free(ch);
  996.             popup = two;
  997.         }
  998.         break;
  999.         case mtacacheadd:
  1000.         XtVaGetValues(three->tuple[0].text,
  1001.                   XtNstring, &str0,
  1002.                   NULL);
  1003.         XtVaGetValues(three->tuple[1].text,
  1004.                   XtNstring, &str1,
  1005.                   NULL);
  1006.         XtVaGetValues(three->tuple[2].text,
  1007.                   XtNstring, &str2,
  1008.                   NULL);
  1009.  
  1010.         if (str0[0] != '\0'
  1011.             && str1[0] != '\0'
  1012.             && str2[0] != '\0') {
  1013.             ch = (uk_order) ? reverse_mta(str1) : str1;
  1014.             MtaControl(*op, ch, 
  1015.                    str2, str0);
  1016.             if (uk_order && ch != str1) free(ch);
  1017.             popup = three;
  1018.         }
  1019.         
  1020.         default:
  1021.         break;
  1022.     }
  1023.     ResetInactiveTimeout();
  1024.     if (popup != NULL)
  1025.         Popdown(popup);
  1026.     else 
  1027.         XBell(XtDisplay(w), 50);
  1028. }
  1029.  
  1030.  
  1031. /* configure buttons */
  1032. #define MINTIMEOUT    30000    /* 1/2 min */
  1033.  
  1034. extern Widget    runChans_sc, qOps_sc, msgOutPs_sc, msgInPs_sc;
  1035.  
  1036. settimeoutFor(str)
  1037. char    *str;
  1038. {
  1039.     newTimes = (unsigned long) (parsetime(str) * 1000);
  1040.     if (newTimes > MINTIMEOUT) 
  1041.         timeoutFor = newTimes;
  1042. }
  1043.  
  1044. extern Widget    statistics;
  1045.         
  1046. /* ARGSUSED */
  1047. void config_OK(w, client_data, call_data)
  1048. Widget    w;
  1049. caddr_t client_data;
  1050. caddr_t call_data;
  1051. {
  1052.     char    *str;
  1053.     int    ok = TRUE,
  1054.         do_reset_refresh = FALSE,
  1055.         do_reset_reconnect = FALSE;
  1056.     
  1057.     if (newautoRefresh != autoRefresh) {
  1058.         autoRefresh = newautoRefresh;
  1059.         do_reset_refresh = TRUE;
  1060.     }
  1061.  
  1062.     XtVaGetValues (config->tuple[REFRESH].text,
  1063.                XtNstring, &str,
  1064.                NULL);
  1065.     newTimes = (unsigned long) (parsetime(str) * 1000);
  1066.     
  1067.     if (newTimes != timeoutFor) {
  1068.         if (newTimes < MINTIMEOUT) {
  1069.             /* BEEP */
  1070.             timeoutFor = MINTIMEOUT;
  1071.             textdisplay(&(config->tuple[REFRESH]),     
  1072.                     unparsetime(timeoutFor / 1000));
  1073.             ok = FALSE;
  1074.         } else {
  1075.             timeoutFor = newTimes;
  1076.             do_reset_refresh = TRUE;
  1077.         }
  1078.         XtVaSetValues(runChans_sc,
  1079.                   XtNupdate, (int) (timeoutFor / 2000),
  1080.                   NULL);
  1081.         XtVaSetValues(qOps_sc,
  1082.                   XtNupdate, (int) (timeoutFor / 2000),
  1083.                   NULL);
  1084.         if (statistics != NULL) {
  1085.             XtVaSetValues(msgInPs_sc,
  1086.                       XtNupdate, (int) (timeoutFor / 2000),
  1087.                       NULL);
  1088.             XtVaSetValues(msgOutPs_sc,
  1089.                       XtNupdate, (int) (timeoutFor / 2000),
  1090.                       NULL);
  1091.         }
  1092.  
  1093.     }
  1094.             
  1095.     XtVaGetValues (config->tuple[INACTIVE].text,
  1096.                XtNstring, &str,
  1097.                NULL);
  1098.     newTimes = (unsigned long) (parsetime(str) * 1000);
  1099.     
  1100.     if (newTimes != inactiveFor) 
  1101.         inactiveFor = newTimes;
  1102.             
  1103.     XtVaGetValues (config->tuple[START].text,
  1104.                XtNstring, &str,
  1105.                NULL);
  1106.     newTimes = (unsigned long) (parsetime(str) * 1000);
  1107.     
  1108.     if (newTimes != connectInit) {
  1109.         connectInit = newTimes;
  1110.         do_reset_reconnect = TRUE;
  1111.     }
  1112.  
  1113.     XtVaGetValues (config->tuple[BACKOFF].text,
  1114.                XtNstring, &str,
  1115.                NULL);
  1116.     newTimes = (unsigned long) (parsetime(str) * 1000);
  1117.     
  1118.     if (newTimes != connectInc) {
  1119.         connectInc = newTimes;
  1120.         do_reset_reconnect = TRUE;
  1121.     }
  1122.  
  1123.     XtVaGetValues (config->tuple[CONNECTMAX].text,
  1124.                XtNstring, &str,
  1125.                NULL);
  1126.     newTimes = (unsigned long) (parsetime(str) * 1000);
  1127.     
  1128.     if (newTimes != connectMax) {
  1129.         connectMax = newTimes;
  1130.         do_reset_reconnect = TRUE;
  1131.     }
  1132.  
  1133.  
  1134.     if (newautoReconnect != autoReconnect) {
  1135.         autoReconnect = newautoReconnect;
  1136.         do_reset_reconnect = TRUE;
  1137.     }
  1138.  
  1139.     if (newbackoff != backoff) {
  1140.         backoff = newbackoff;
  1141.         do_reset_reconnect = TRUE;
  1142.     }
  1143.  
  1144.     if (newconfirm != confirm)
  1145.         confirm = newconfirm;
  1146.     if (newcompat != compat) {
  1147.         if (statistics != NULL) {
  1148.             compat = newcompat;
  1149.             redo_statistics_compat();
  1150.         } else
  1151.             ok = FALSE;
  1152.  
  1153.     }
  1154.     if (newdisplayInactIns != displayInactIns)
  1155.         displayInactIns = newdisplayInactIns;
  1156.  
  1157.     if (newheur != heuristic)
  1158.         heuristic = newheur;
  1159.     switch (heuristic) {
  1160.         case percentage:
  1161.         XtVaGetValues (config->tuple[PERCENT].text,
  1162.                    XtNstring, &str,
  1163.                    NULL);
  1164.         if ((newint = atoi(str)) != 0)
  1165.             percent = newint;
  1166.         XtVaGetValues (config->tuple[MINBADMTA].text,
  1167.                    XtNstring, &str,
  1168.                    NULL);
  1169.         if ((newint = atoi(str)) != 0)
  1170.             lower_bound_mtas = newint;
  1171.         break;
  1172.         case line:
  1173.         XtVaGetValues (config->tuple[LINEMAX].text,
  1174.                    XtNstring, &str,
  1175.                    NULL);
  1176.         if ((newint = atoi(str)) != 0)
  1177.             max_vert_lines = newint;
  1178.         break;
  1179.         default:
  1180.         break;
  1181.     }
  1182.     if (do_reset_refresh == TRUE
  1183.         && connectState == connected) 
  1184.         InitRefreshTimeOut((unsigned long) 500);
  1185.     if (do_reset_reconnect == TRUE
  1186.         && connectState != connected
  1187.         && userConnected == TRUE) InitConnectTimeOut();
  1188.     ResetInactiveTimeout();
  1189.     if (ok == TRUE) 
  1190.         Popdown(config);
  1191.     else
  1192.         XBell(XtDisplay(w), 50);
  1193.  
  1194. }
  1195.  
  1196. extern Popup_menu    *currentpopup,
  1197.             *qcontrol;
  1198.  
  1199. extern Widget    line_form, percent_form;
  1200.  
  1201. /* ARGSUSED */
  1202. void heurToggle (w, pheur, call_data)
  1203. Widget    w;
  1204. Heuristic    *pheur;
  1205. caddr_t    call_data;
  1206. {
  1207.     if (currentpopup != config)
  1208.         return;
  1209.     switch (*pheur) {
  1210.         case percentage:
  1211.         *pheur = line;
  1212.         XtVaSetValues(w,
  1213.               XtNlabel, LINE_BASED,
  1214.               NULL);
  1215.         XtSetMappedWhenManaged (line_form, True);
  1216.         XtSetMappedWhenManaged (percent_form, False);
  1217.         break;
  1218.  
  1219.         case line:
  1220.         *pheur = all;
  1221.         XtVaSetValues(w,
  1222.               XtNlabel, ALL_BASED,
  1223.               NULL);
  1224.         XtSetMappedWhenManaged (line_form, False);
  1225.         XtSetMappedWhenManaged (percent_form, False);
  1226.         break;
  1227.  
  1228.         case all:
  1229.         *pheur = chanonly;
  1230.         XtVaSetValues(w,
  1231.               XtNlabel, CHANONLY_BASED,
  1232.               NULL);
  1233.         XtSetMappedWhenManaged (line_form, False);
  1234.         XtSetMappedWhenManaged (percent_form, False);
  1235.         break;
  1236.         case chanonly:
  1237.         *pheur = percentage;
  1238.         XtVaSetValues (w,
  1239.                    XtNlabel, PERCENT_BASED,
  1240.                    NULL);
  1241.         XtSetMappedWhenManaged (line_form, False);
  1242.         XtSetMappedWhenManaged (percent_form, True);
  1243.         break;
  1244.     }
  1245. }
  1246.  
  1247. extern Widget    auth_toggle;
  1248.  
  1249. /* ARGSUSED */
  1250. void configToggle(w, pint, call_data)
  1251. Widget    w;
  1252. int    *pint;
  1253. caddr_t    call_data;
  1254. {
  1255.     if (currentpopup == NULL)
  1256.         return;
  1257.     if (*pint == TRUE) {
  1258.         /* enabled -> disabled */
  1259.         *pint = FALSE;    
  1260.         XtVaSetValues(w,
  1261.               XtNlabel, "disabled",
  1262.               NULL);
  1263.         if (w == auth_toggle
  1264.             && currentpopup->selected != 0) {
  1265.             XtSetKeyboardFocus(top,
  1266.                        currentpopup->tuple[0].text);
  1267.             XtSetKeyboardFocus(currentpopup->form, 
  1268.                        currentpopup->tuple[0].text);
  1269.             XtVaSetValues(currentpopup->tuple[0].text,
  1270.                   XtNborderColor, fg,
  1271.                   NULL);
  1272.             XtVaSetValues(currentpopup->tuple[currentpopup->selected].text,
  1273.                   XtNborderColor, bg,
  1274.                   NULL);
  1275.             currentpopup->selected = 0;
  1276.         }
  1277.  
  1278.     } else {
  1279.         /* disabled -> enabled */
  1280.         *pint = TRUE;
  1281.         XtVaSetValues(w,
  1282.               XtNlabel, "enabled",
  1283.               NULL);
  1284.     }
  1285.     if (w == auth_toggle)
  1286.         SetAuthDisplay(*pint);
  1287.     ResetInactiveTimeout();
  1288. }
  1289.  
  1290. void SetAuthDisplay(bool)
  1291. int    bool;
  1292. {
  1293.     XtSetMappedWhenManaged(connectpopup->tuple[2].label, bool);
  1294.     XtSetMappedWhenManaged(connectpopup->tuple[3].label, bool);
  1295.     XtSetMappedWhenManaged(connectpopup->tuple[2].text, bool);
  1296.     XtSetMappedWhenManaged(connectpopup->tuple[3].text, bool);
  1297.     if (bool == TRUE) {
  1298.         textdisplay(&(connectpopup->tuple[2]),
  1299.                 (username == NULL) ? "" : username);
  1300.         password[0] = '\0';
  1301.         textdisplay(&(connectpopup->tuple[3]),"");
  1302.     }        
  1303. }
  1304.  
  1305. /* ARGSUSED */
  1306. void connectpopup_OK(w, client_data, call_data)
  1307. Widget    w;
  1308. caddr_t client_data;
  1309. caddr_t call_data;
  1310. {
  1311.     char    *str0, *str1, *str2;
  1312.     if (newauth != auth) 
  1313.         auth = newauth;
  1314.  
  1315.     XtVaGetValues (connectpopup -> tuple[0].text,
  1316.                XtNstring, &str0,
  1317.                NULL);
  1318.     XtVaGetValues (connectpopup -> tuple[2].text,
  1319.                XtNstring, &str2,
  1320.                NULL);
  1321.     if (str0[0] == '\0'
  1322.         || (auth == TRUE && str2[0] == '\0')) {
  1323.         XBell(XtDisplay(w), 50);
  1324.         return;
  1325.     }
  1326.     
  1327.     XtVaGetValues (connectpopup -> tuple[1].text,
  1328.                XtNstring, &str1,
  1329.                NULL);
  1330.     if (str1[0] == '\0')
  1331.         tailorfile[0] = '\0';
  1332.     else
  1333.         strcpy(tailorfile, str1);
  1334.  
  1335.     if (str2[0] != '\0')
  1336.         strcpy(username, str2);
  1337.     fillin_passwdpep(username, password, auth);
  1338.     StartWait();
  1339.     Connect(str0);
  1340.     EndWait();
  1341.     ResetInactiveTimeout();
  1342.     Popdown(connectpopup);
  1343. }
  1344.  
  1345. /* ARGSUSED */
  1346. void QControlPopup(w, op, call_data)
  1347. Widget    w;
  1348. int    op;
  1349. caddr_t    call_data;
  1350. {
  1351.     int    x,y;
  1352.     Window    r_child;
  1353.     
  1354.     XTranslateCoordinates(XtDisplay(w),XtWindow(w),
  1355.                   XDefaultRootWindow(XtDisplay(w)),0,0,&x,&y,
  1356.                   &r_child);
  1357.     ResetInactiveTimeout();
  1358.     Popup(qcontrol, unknown, x, y);
  1359.     
  1360. }
  1361. extern int    msgs_ub;
  1362. /* ARGSUSED */
  1363. void MsgsShowAll (w, client_data, call_data)
  1364. Widget    w;
  1365. caddr_t    client_data,
  1366.     call_data;
  1367. {
  1368.     msgs_ub = False;
  1369.     control_display_msgs();
  1370.     msgs_ub = True;
  1371. }
  1372.  
  1373. /* ARGSUSED */
  1374. void QControl(w, op, call_data)
  1375. Widget    w;
  1376. int    op;
  1377. caddr_t    call_data;
  1378. {
  1379.     my_invoke(quecontrol, (char **) op);
  1380.     ResetInactiveTimeout();
  1381.     Popdown(qcontrol);
  1382. }
  1383.  
  1384. /*   */
  1385. extern Widget    channel_commands,
  1386.         mta_commands,
  1387.         msg_commands,
  1388.         qcontrol_command;
  1389.  
  1390. SensitizeButtons(bool)
  1391. int    bool;
  1392. {
  1393.     XtSetSensitive(qcontrol_command,bool);
  1394.     XtSetSensitive(channel_commands,bool);
  1395.     XtSetSensitive(mta_commands,bool);
  1396.     XtSetSensitive(msg_commands,bool);
  1397. }
  1398.  
  1399.  
  1400.  
  1401.